<template>
  <div class="container">
    <div class="container-head flex_btw">
      <div class="head-title flex_x">
        <img class="head-icon" src="@/assets/images/add.png" alt="" />
        <span>新增</span>
      </div>
    </div>
    <div class="container-main">
      <el-form :model="formList" label-width="auto" size="large">
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="编号"
              ><el-input v-model="formList.name" placeholder="请输入预警名称"
            /></el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="姓名"
              ><el-input v-model="formList.name" placeholder="请输入预警名称"
            /></el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="手机"
              ><el-input v-model="formList.name" placeholder="请输入预警名称"
            /></el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="密码"
              ><el-input v-model="formList.name" placeholder="请输入预警名称"
            /></el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="10">
            <el-form-item label="部门职务">
              <el-row style="width: 100%" justify="space-between">
                <el-col :span="11">
                  <el-select
                    v-model="formList.brand"
                    label="brand"
                    placeholder="Select"
                    size="large"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-col>
                <el-col :span="11">
                  <el-select
                    v-model="formList.duties"
                    label="duties"
                    placeholder="Select"
                    size="large"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </el-col>
              </el-row>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="角色名">
              <el-select
                v-model="formList.duties"
                label="duties"
                placeholder="Select"
                size="large"
              >
                <el-option label="sex" value="sex" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="备注">
          <el-col>
            <el-input v-model="formList.con" type="textarea" :rows="6" />
          </el-col>
        </el-form-item>
        <el-form-item label="状态">
          <el-switch v-model="formList.status" size="large" />
        </el-form-item>
      </el-form>
      <div class="flex_c">
        <el-button size="large" @click="router.back()">取消</el-button>
        <el-button size="large" type="primary" @click="onSubmit"
          >新增</el-button
        >
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { Search } from "@element-plus/icons-vue";
import { useRouter } from "vue-router";
import { Plus, Minus } from "@element-plus/icons-vue";
const router = useRouter();
const params = ref("");
const formList = reactive({
  name: "",
  target: "指标单数",
  status: true,
  brand: "",
  duties: "",
});
const tableData = ref([
  {
    role: "配置",
    isOpen: true,
    isAll: true,
    child: ["Shanghai", "Beijing"],
    cities: ["Shanghai", "Beijing", "Guangzhou", "Shenzhen"],
  },
]);

const allCheckChange = (item: any) => {
  item.child = item.isOpen ? item.cities : [];
};
const checkChange = (item: any) => {
  item.isOpen = item.child.length === item.cities.length;
};
const onSubmit = () => {
  console.log("submit!");
};
const options = [
  {
    value: "Option1",
    label: "Option1",
  },
  {
    value: "Option2",
    label: "Option2",
  },
  {
    value: "Option3",
    label: "Option3",
  },
  {
    value: "Option4",
    label: "Option4",
  },
  {
    value: "Option5",
    label: "Option5",
  },
];
</script>
<style lang="scss" scoped></style>
